#ifndef MDIAREAPLAYER_H
#define MDIAREAPLAYER_H

#include <QMdiArea>
#include <QtDeclarative/QDeclarativeView>
#include <QWidget>
#include <QTimer>
#include "mplayerwrapper.h"

class MdiAreaPlayer : public QMdiArea
{
    Q_OBJECT
public:
    explicit MdiAreaPlayer(QString appHome,MPlayerWrapper * player,QWidget *parent=0);
    QMdiSubWindow * sw;
    Q_INVOKABLE void willHideProgressBar();

signals:
    void mPlayerKeyPress(int keyCode);

private slots:
    void resizePerAspect();
    void started(int length, double aspect);
    void hideProgressBar();

private:
    QDeclarativeView * qmlViewer;
    QMdiSubWindow * swQml;
    double mAspect;
    QTimer *refreshWTimer;
    QTimer * progressBarTimer;



    void showProgressBar();
    void resizeEvent(QResizeEvent *resizeEvent);
    void keyPressEvent ( QKeyEvent * event );
};

#endif // MDIAREAPLAYER_H
